<?php

	include("dboper.php");

	if(!@$_POST['akses'] == true) {
	   die('Akses langsung tidak diperbolehkans!');
	}
		
	ob_start(); 
	system("ipconfig /all"); 
	$cominfo=ob_get_contents(); 
	ob_clean(); 
	$search = "Physical";
	$primarymac = strpos($cominfo, $search); 
	$mac=substr($cominfo,($primarymac+36),17);//MAC Address
 
    $listIdAsisten = $_POST['listidasisten'];
    $asistenId = getAsistenIdById($listIdAsisten);

	while($data = mysql_fetch_assoc($asistenId)){
        $row[] = $data;
    }
   
    $makul = $_POST['matakuliah'];	
    $kelas =  $_POST['kelas'];
    $pesanFor = $_POST['grupPesan'];
	$japrak = $_POST['japrak'];
    //$pesan =  mysql_real_escape_string($_POST['txtPesan']['id_asisten']);
    $sendPesan = '';

    for($i = 1; $i <= $_POST['jml']; $i++){
            $id = $row[$i-1]['id_asisten'];	
	        $n1 = $_POST['grupMateri'.$row[$i-1]['id_asisten']];	
            $n2 = $_POST['grupSuasana'.$row[$i-1]['id_asisten']];	
            $n3 = $_POST['grupBerbicara'.$row[$i-1]['id_asisten']];	
            $n4 = $_POST['grupDisiplin'.$row[$i-1]['id_asisten']];
        	$msg= $_POST['txtPesan'.$row[$i-1]['id_asisten']];
            /*if($pesanFor == $id) {
                $sendPesan = $pesan;
            } else {
                $sendPesan = '-';
            }*/
            $det = 'N1='.$n1.',N2='.$n2.',N3='.$n3.',N4='.$n4.'';
                
            $total = ($n1 + $n2 + $n3 + $n4) / 4;
        	sendVoteMulti($id,$msg,$total,$mac,'makul','kelas',$det,$japrak);
    }

?>
